1. Field of the Invention
The present invention generally relates to computer systems, and in particular, to a method and a corresponding system for bootstrapping from multiple boot images.
2. Description of the Related Art
The term xe2x80x9cbootstrappingxe2x80x9d is used to describe a process in which a computer system, when it is first powered up or initialized, fetches initial program instructions (e.g., basic input/output system (BIOS)) from a predetermined location. The BIOS is a set of software routines stored in a non-volatile storage device such as a flash memory or a read only memory (ROM) that tests hardware at startup, starts the operating system and supports the transfer of data among hardware devices. The BIOS can be configured by a user to statically point to a specified location on a mass storage device (e.g., the xe2x80x9cboot sectorxe2x80x9d of a particular disk drive) to fetch a xe2x80x9cboot image.xe2x80x9d The boot image contains a first portion of bootstrapping instructions that are performed right after control is transferred from the BIOS. In other words, during power up or reset of a computer system, the BIOS is first loaded and the control is passed to the boot image which in turn performs certain operations to load and initialize an operating system.
It is desirable to incorporate multiple copies of the boot image into a computer system so that an operating system can be loaded and initialized even if one of the boot images is corrupted. This is accomplished in many conventional systems by maintaining two or more xe2x80x9cmirrored copiesxe2x80x9d of the boot image on independent disk drives. In such systems, the BIOS is programmed to compare or check sum the boot image copies upon power up and transfer control only to one boot image that is agreed by a majority to be a good (uncorrupted) boot image. Such systems can be very complex if many copies of the boot image are to be maintained. On the other hand, if only a small number of boot images, such as two copies are used (or if more than a majority of the images have been corrupted), the system may make a wrong guess and choose to boot from a corrupted copy, in which case the system may hang half-way through the bootstrapping process when it encounters corrupted code. In these cases, the bootstrapping process generally cannot be completed even if the system is equipped with a watch-dog timer (also commonly called a xe2x80x9cdead man""s switchxe2x80x9d) which forces the machine to reboot itself after a preset period of inactivity/non-response since the system may repeatedly attempt to reboot from the same corrupted image.
According to one aspect of the invention, a system for booting from one of multiple boot images is provided that includes a processor coupled to a main memory, a number of boot devices and a selector. The boot devices are used to store multiple copies of a boot image and are in communication with the processor through a controller. The selector is used to select a different boot device each time the system is turned on or reset. A set of instructions executed by the processor loads the boot image from one of the boot devices selected by the selector into the main memory.
In one embodiment, the selector is embodied in the form of software instructions incorporated into or linked to a system BIOS program. In another embodiment, the selector is embodied in the form of software instructions incorporated into or linked to a SCSI BIOS program. In yet another embodiment, the selector is embodied in the form of a selector switch coupled between a controller and the boot devices, wherein when a power switch of the system is actuated, the selector switch connects a different boot device to a port designated as a boot device port.